home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / msjv6-5.zip / ICONEX.ZIP / ICONEX.H < prev    next >
Text File  |  1991-09-01  |  3KB  |  108 lines

  1. /*
  2.  * WINDOWS ICON EXTRACTION UTILITY - HEADER FILE
  3.  *
  4.  * LANGUAGE : Microsoft C 6.0
  5.  * TOOLKIT  : Windows 3.0 SDK
  6.  * MODEL    : Medium
  7.  * STATUS   : Operational
  8.  *
  9.  * 07/04/91 - Kevin P. Welch - initial creation.
  10.  *
  11.  */
  12.  
  13. /* standard data types */
  14. typedef char                CHAR;        /* ch   : 8-bit signed integer */
  15. typedef int                    INT;        /* n    : signed integer */
  16. typedef unsigned short    USHORT;    /* us   : 16-bit unsigned integer */
  17. typedef unsigned long    ULONG;    /* ul   : 32-bit unsigned integer */
  18. typedef int                    HFILE;    /* hf   : DOS file handle */
  19. typedef CHAR FAR *        LPSZ;        /* lpsz : pointer to z-string    */
  20.  
  21. /* general programming extensions */
  22. #define ID(x)           GetWindowWord(x,GWW_ID)
  23. #define PARENT(x)       GetWindowWord(x,GWW_HWNDPARENT)
  24. #define INSTANCE(x)     GetWindowWord(x,GWW_HINSTANCE)
  25. #define WARNING(x,y)        MessageBox(x,y,"Icon Extractor",MB_OK|MB_ICONHAND);
  26.  
  27. /* dialog box definitions */
  28. #define  ID_FILE            100        /* file name */
  29. #define    ID_FILELIST        101        /* directory list */
  30. #define    ID_ICONS            102        /* icon list */
  31. #define    ID_OPEN            103        /* open file button */
  32. #define    ID_COPY            104        /* copy icon button */
  33. #define    ID_EXIT            105        /* exit button */
  34. #define    ID_PATH            106        /* current directory path */
  35. #define    ID_ABOUT            107        /* about button */
  36.  
  37. /* */
  38.  
  39. /*
  40.  * ICON HANDLING DATA STRUCTURES
  41.  *
  42.  */
  43.  
  44. /* general definitions */
  45. #define MAXLENGTH            128
  46. #define ICONDATAHANDLE    "IconDataHandle"
  47. #define ICONCLIPFMT        "IconClipFmt"
  48.  
  49. /* program specific types */
  50. typedef struct {
  51.     WORD            wIconType;
  52.     WORD            wWidth;
  53.     WORD            wHeight;
  54.     BYTE            bPlanes;
  55.     BYTE            bBitsPixel;
  56.     HBITMAP        hbmANDbits;
  57.     HBITMAP        hbmXORbits;
  58.     LONG            lFilePos;
  59. } ICON;
  60.  
  61. typedef ICON FAR *         LPICON;
  62.  
  63. typedef struct {
  64.     WORD            wArraySize;
  65.     ICON            icIconArray[1];
  66. } ICONDATA;
  67.  
  68. typedef ICONDATA FAR *     LPICONDATA;
  69.  
  70. /* error codes for file handling functions */
  71. #define  IDERR_SUCCESS                0
  72. #define  IDERR_BASE                    255
  73. #define  IDERR_ALLOCFAIL            (IDERR_BASE+1)    
  74. #define  IDERR_LOCKFAIL                (IDERR_BASE+2)
  75. #define  IDERR_OPENFAIL                (IDERR_BASE+3)
  76. #define  IDERR_READFAIL                (IDERR_BASE+4)
  77. #define  IDERR_WINFUNCFAIL            (IDERR_BASE+5)
  78. #define  IDERR_INVALIDPARAM        (IDERR_BASE+6)
  79. #define  IDERR_FILETYPEBAD            (IDERR_BASE+7)    
  80. #define  IDERR_EXETYPEBAD            (IDERR_BASE+8)    
  81. #define  IDERR_WINVERSIONBAD        (IDERR_BASE+9)
  82. #define  IDERR_RESTABLEBAD            (IDERR_BASE+10)
  83. #define  IDERR_ICONBAD                (IDERR_BASE+11)
  84. #define  IDERR_NOICONS                (IDERR_BASE+12)
  85. #define  IDERR_ARRAYFULL            (IDERR_BASE+13)
  86.  
  87. /* */
  88.  
  89. /* 
  90.  * FUNCTION PROTOTYPES
  91.  *
  92.  */
  93.  
  94. /* function prototypes for iconex01.c */
  95. BOOL  FAR PASCAL CenterPopup( HWND, HWND );
  96. BOOL    FAR PASCAL OpenExeFile( HWND, LPSTR );
  97. BOOL  FAR PASCAL Dialog( HWND, LPSTR, FARPROC );
  98. BOOL  FAR PASCAL AboutDlgFn( HWND, WORD, WORD, LONG );
  99. BOOL  FAR PASCAL IconExDlgFn( HWND, WORD, WORD, LONG );
  100.  
  101. /* function prototypes for iconex02.c */
  102. WORD  FAR PASCAL IconExtract( LPSZ, LPHANDLE, LPWORD );
  103. WORD  FAR PASCAL IconFree( HANDLE );
  104. WORD  FAR PASCAL IconCreateIcon( HWND, HANDLE, WORD, LPHANDLE );
  105. WORD  FAR PASCAL IconGetIconDescrip( HANDLE, WORD, LPSZ );
  106. WORD  FAR PASCAL IconCopyToClipboard( HWND, HANDLE, WORD, WORD );
  107.  
  108.